package com.huaxin.hxmoduleworkorder.common.validator;

import com.huaxin.hxmoduleworkorder.common.annotation.validation.ValidInspectionOrderStatus;
import com.huaxin.hxmoduleworkorder.common.enums.InspectionOrderStatus;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class InspectionOrderStatusValidator implements ConstraintValidator<ValidInspectionOrderStatus, String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return value == null || InspectionOrderStatus.isValid(value);
    }
}
